package cc.mrbird.febs.pedometer.controller;

import cc.mrbird.febs.common.entity.FebsConstant;
import cc.mrbird.febs.common.utils.FebsUtil;
import cc.mrbird.febs.job.entity.Job;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.constraints.NotBlank;

/**
 * @author li
 * @date 2020-1-30
 */
@Controller()
@RequestMapping(FebsConstant.VIEW_PREFIX + "pedometer")
public class ViewController {
    @GetMapping("batches")
    public Object batchesIndex(){
        return FebsUtil.view("pedometer/batches");
    }

    @GetMapping("chicken/{batchesId}")
    public String chickenIndex(@PathVariable Integer batchesId, Model model){
        model.addAttribute("batchesId", batchesId);
        return FebsUtil.view("pedometer/chicken");
    }
    @GetMapping("chicken/update/{chickenId}")
    public String chickenUpdateIndex(@PathVariable Integer chickenId, Model model){
        model.addAttribute("batchesId", chickenId);
        return FebsUtil.view("pedometer/chickenUpdate");
    }

}
